"use strict";

// ./node_modules/.bin/sequelize migration:create --name UserInit

module.exports = {
    up: async (queryInterface, Sequelize) => {
        return queryInterface.createTable("User", {
            id: {
                type: Sequelize.INTEGER,
                primaryKey: true,
                autoIncrement: true,
            },
            name: {
                type: Sequelize.STRING(20),
                unique: true,
                allowNull: false,
            },
            password: {
                type: Sequelize.STRING(32),
                allowNull: false,
            },
            createAt: {
                type: Sequelize.DATE,
                allowNull: false,
            },
        });
    },

    down: async (queryInterface, Sequelize) => {
        return queryInterface.dropTable("User");
    },
};
